package com.kaka.service.serviceimpl;

import com.kaka.javabean.User;
import com.kaka.mapper.UserMapper;
import com.kaka.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("userService")
public class UserServiceImpl implements UserService {

    @Autowired
    UserMapper userMapper;

    @Override
    public List<User> selectAll() {
        return userMapper.selectAll();
    }

    @Override
    public int editInfo(int id, String username, String password) {
        int i = userMapper.updateUserNameById(id, username);
        int j = userMapper.updatePasswordById(id, password);
        return i + j;
    }
}
